using System;

namespace Graphe.RobinsonPierpont
{
    public class Verse
    {
        #region Constructor

        /// <summary>
        /// Default constructor
        /// </summary>
        public Verse()
        {
        }

        #endregion
        #region Private Instance Fields

        private int _number;
        private string _text;

        #endregion
        #region Public Properties

        public int Number
        {
            get { return _number; }
            set { _number = value; }
        }

        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        #endregion

        public int GetCharacterCount(bool includeSpaces, bool includePunctuation)
        {
            string stringToCount = Text;

            if (!includeSpaces)
                stringToCount = stringToCount.Replace(" ", String.Empty);

            if (!includePunctuation)
            {
                stringToCount = stringToCount.Replace(".", String.Empty);
                stringToCount = stringToCount.Replace(",", String.Empty);
                stringToCount = stringToCount.Replace(";", String.Empty);
            }

            return stringToCount.Length;
        }
    }
}
